-module(session).
-compile(export_all).

-include("usr.hrl").

getsock_by_name(Name) ->
	case ets:lookup(socksession,Name) of
	  []->
		error;
	  [Rec]->
		Rec#socksession.sock
	end.

getname_by_sock(Sock)->
	case ets:lookup(namesession,Sock) of
	[] ->
		error;
	[Rec]->
		Rec#namesession.name
	end.